package demo1;

public class OuterClass1 {
    public int data1 = 1;
    private int data2 = 2;
    public static final int data3 = 3;

    public void test(){
        System.out.println("外部类的test方法被执行了...");
    }

    //实例内部类
    class InterClass{
        public int data4 = 4;
        private int data5 = 5;
        public static final int data6 = 6;

        public int data1 = 10;

        public void test(){
            System.out.println("实例内部类的test方法被执行了...");

            //调用外部类的data1的方法
            System.out.println(OuterClass1.this.data1);

            System.out.println(data1);
            System.out.println(data2);
            System.out.println(data3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println(data6);
        }


    }
}


